home *** CD-ROM | disk | FTP | other *** search
/ Openstep 4.2 (Developer) / Openstep Developer 4.2.iso / NextLibrary / Frameworks / NIAccess.framework / Versions / A / Headers / NIServer.h < prev   
Encoding:
C/C++ Source or Header  |  1995-07-28  |  2.0 KB  |  95 lines

  1. /*
  2.     NIServer.h
  3.     NetInfo Server Class
  4.     Copyright (c) 1994, NeXT Computer, Inc.
  5.     All rights reserved.
  6.  */
  7.  
  8. #ifndef STRICT_OPENSTEP
  9.  
  10. #import <Foundation/NSString.h>
  11. #import <Foundation/NSDictionary.h>
  12. #import <Foundation/NSDate.h>
  13. @class NSHost;
  14.  
  15. @interface NIServer : NSObject
  16. {
  17.     @private
  18.     NSString *serverName;
  19.     NSHost *host;
  20.     NSString *tag;
  21.     void *connection;
  22.     int timeout;
  23.     int abort;
  24.     BOOL isMaster;
  25.     BOOL _didSetIsMaster;
  26.     id reserved;
  27. }
  28.  
  29. /*
  30.  * Get a server object.  Server are cached by default (see below).
  31.  */
  32. + (NIServer *)serverWithHost:(NSHost *)aHost tag:(NSString *)aTag;
  33. + (NIServer *)serverWithHost:(NSHost *)aHost
  34.     tag:(NSString *)aTag
  35.     readTimeout:(NSTimeInterval)rtime
  36.     writeTimeout:(NSTimeInterval)wtime;
  37.  
  38. /*
  39.  * Server cache management
  40.  * If enabled, only one object representing each server is created, and
  41.  * a shared instance is returned by all methods that return a server.
  42.  */
  43. + (BOOL)isServerCacheEnabled;
  44. + (void)setServerCacheEnabled:(BOOL)flag;
  45. + (void)flushServerCache;
  46.  
  47. /* 
  48.  * name, host and tag.
  49.  * names are strings of the form: @"hostname/tag"
  50.  */
  51. - (NSString *)name;
  52. - (NSHost *)host;
  53. - (NSString *)serverTag;
  54.  
  55. /* 
  56.  * Server information.
  57.  */ 
  58. - (BOOL)isMaster;
  59. - (BOOL)isClone;
  60. - (NSDictionary *)statistics;
  61. - (NIServer *)parentServer;
  62.  
  63. /*
  64.  * Force a synchronization. If connected to the master this
  65.  * syncs the whole domain.  If connected to a clone, then force
  66.  * the clone to synchronize with the master.
  67.  */
  68. - (void)synchronize;
  69.  
  70. /*
  71.  * Check server
  72.  */
  73. - (BOOL)isAlive;
  74.  
  75. /*
  76.  * Get netinfo(3) library handle.
  77.  * Use of the handle should be avoided if at all possible.
  78.  * If the handle is used to make netinfo(3) library calls, and the 
  79.  * application is multi-threaded, then the call should be protected using
  80.  * NINetInfo "lock" and "unlock".  For example:
  81.  *
  82.  * ni_status status;
  83.  * NINetInfo *ni = [NINetInfo netinfo];
  84.  * void *handle = [aServer handle];
  85.  * [ni lock];
  86.  * status = ni_read(handle, ...);
  87.  * [ni unlock];
  88.  *
  89.  */
  90. - (void *)handle;
  91.  
  92. @end
  93.  
  94. #endif STRICT_OPENSTEP
  95.